import java.io.*;
import java.util.regex.*;
public class dupes {
    public static void main (String[] args) throws IOException {
        if (args.length<1) throw new RuntimeException ("not enough arguments");
        if (args.length>1) throw new RuntimeException ("too many arguments");
        BufferedReader reader = new BufferedReader (new FileReader (new File (args[0])));
        String line;
        while ((line = reader.readLine()) !=null){
            line = line.replaceAll("(\\d(?:,)|(?:$))\\1+","$1");
            System.out.println(line);
          }
    }

}
